package com.jd.header.util;

import com.google.gson.Gson;
import com.jd.header.entity.BaseEntity;

public class JsonUtil {

    /**
     * json串转实体类对象
     *
     * @param response
     * @param baseEntity
     * @return
     */
    public static BaseEntity fromJson(String response, BaseEntity baseEntity) {
        baseEntity = new Gson().fromJson(response, baseEntity.getClass());
        return baseEntity;
    }
}
